package com.ficus.road.maintain.service;

import com.ficus.road.maintain.core.model.DiseaseType;
import com.ficus.road.maintain.dao.DiseaseTypeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author jinbiao.he
 * @Since 2021/4/8 上午11:19
 */
@Service
public class DiseaseTypeService {

    @Autowired
    private DiseaseTypeDao diseaseTypeDao;

    public String createType(DiseaseType diseaseType) {
        DiseaseType type = diseaseTypeDao.saveOrUpdate(diseaseType);
        return type.getId();
    }

    public List<DiseaseType> list() {
        return diseaseTypeDao.findAll();
    }
}
